<template>
  <div class="background">
    <div class="not-found">
      <h1>404</h1>
      <label>
        <input type="checkbox" />
        <div class="card">
          <div class="front">
            <p class="chinese-opps">很抱歉，您要查找的页面不存在</p>
            <p class="chinese-description">您可能输入了错误的地址，或者页面可能已移动</p>
          </div>
          <div class="back">
            <p class="english-opps">This page could not be found.</p>
            <p class="english-description">
              You may have entered the wrong address, or the page may have moved.
            </p>
          </div>
        </div>
      </label>
      <button class="back-home-btn" title="back home" @click="handleLinkClick">回到主页</button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import {onMounted} from "vue";

const router = useRouter()

function handleLinkClick() {
  router.push('/main/index')
}
onMounted(() => {
  document.title = '404 - 实力接单'
})
</script>

<style scoped>
.background {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-image: linear-gradient(315deg, #eec0c6 20%, #7ee8fa 124%);
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Arial', sans-serif;
  flex-wrap: wrap;
  z-index: 1;
}

h1 {
  color: #beffff;
  text-shadow: 0 0 10px rgba(161, 161, 161, 0.455);
  font-size: 10em;
  font-weight: bold;
}

label {
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  display: block;
  width: 400px;
  height: 75px;
  cursor: pointer;
}

.card {
  position: relative;
  height: 100%;
  width: 100%;
  text-align: center;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: all 600ms;
  transition: all 600ms;
  border-radius: 16px;
}

.card div {
  position: absolute;
  height: 100%;
  width: 100%;
  width: 100%;
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 16px;
}

.card .back {
  background: #222;
  background: rgba(0, 0, 0, 0.5);
  -webkit-transform: rotateX(180deg);
  transform: rotateX(180deg);
  border-radius: 16px;
}

label:hover .card {
  -webkit-transform: rotateX(20deg);
  transform: rotateX(20deg);
  box-shadow: 0 20px 20px rgba(50, 50, 50, 0.2);
}

input {
  display: none;
}

:checked + .card {
  transform: rotateX(180deg);
  -webkit-transform: rotateX(180deg);
}

label:hover :checked + .card {
  transform: rotateX(160deg);
  -webkit-transform: rotateX(160deg);
  box-shadow: 0 20px 20px rgba(255, 255, 255, 0.2);
}

.chinese-opps {
  font-size: 1.5em;
  color: #333333;
  padding: 10px;
}

.chinese-description {
  font-size: 1em;
  color: #666666;
}

.english-opps {
  font-size: 1.5em;
  color: #ffffff;
}

.english-description {
  font-size: 1em;
  color: #cfcfcf;
}

.back-home-btn {
  margin-top: 20px;
  border-radius: 5px;
  z-index: 1;
  position: relative;
  font-size: inherit;
  font-family: inherit;
  color: #f56c6c;
  padding: 0.5em 1em;
  outline: none;
  border: none;
  background: rgba(0, 0, 0, 0);
  overflow: hidden;
  transition: color 0.4s ease-in-out;
}

.back-home-btn::before {
  content: '';
  z-index: -1;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background-color: #f56c6c;
  transform-origin: center;
  transform: translate3d(-50%, -50%, 0) scale3d(0, 0, 0);
  transition: transform 0.45s ease-in-out;
}

.back-home-btn:hover {
  cursor: pointer;
  color: rgb(255, 255, 255);
}

.back-home-btn:hover::before {
  transform: translate3d(-50%, -50%, 0) scale3d(15, 15, 15);
}

@media (max-width: 480px) {
  label {
    width: 300px;
    height: 55px;
  }

  h1 {
    font-size: 5em;
  }

  .message-box {
    padding: 10px;
  }

  .chinese-opps {
    font-size: 1em;
  }

  .chinese-description {
    font-size: 0.2em;
  }

  .english-opps {
    font-size: 1em;
  }

  .english-description {
    font-size: 0.2em;
  }
}
</style>
